<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
{% load tags %}
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>{% block title %}Connecting {{ profile.first_name }}{% endblock %}</title>
                <link href="/{{ media_url }}contifyuser/css/user_profile.css" media="screen, projection" rel="stylesheet" type="text/css"/>    

                {% block extracss %}{% endblock %}

                {% block extrajs %}
                        <script src="/{{ media_url }}contifyuser/js/jquery-1.4.2.min.js" type="text/javascript"></script>
                        <script type="text/javascript">
                            $(document).ready(function(){$("a.delGroup").click(function(){
                                var gwebaddr = $(this).attr('gwebaddr');
                                
                                var isDelete=confirm("Are you sure you want to delete this group?");
                                if (isDelete)
                                        jQuery.ajax({
                                                url: '/connectpeople/home/',
                                                type: 'POST',
                                                data: {'gwebaddr':gwebaddr},
                                                dataType: 'json',
                                                success: function(json){
                                                        document.getElementById(gwebaddr).style.display="none";
                                              },
                                                error: function(xhr, ajaxOptions, thrownError){
                                                        alert("An Error Has Occurred. Please try again.");
                                                }
                                              });
                                        
                                else
                                {
                                        alert("Aap achhe insaan ho. Khuda aapko bachhe de !! :)");
                                }
                                
                                });
                            });
                        </script>
                {% endblock %}

                <meta name="robots" content="{% block robots %}index,follow{% endblock %}" />
</head>

<body>
{% block user_profile %}
        
        <div class="subPageHeader">
                <div>            
                        <div class="noLeftBreak"><a style="text-decoration: none;" href="/connectpeople/home"><span class="headerTitle"><strong>Connect People</strong></span></a></div>
                        <div class="noRightBreak topBarText"><a class="topBarLink" href="{% url contifyuser.views.logout_user %}"><span class="">Logout</span></a></div>
                </div>        
        </div>
        <div>
                <div class="userProfilePic">
                        {{ profile.photo|thumbnail }}
                        <div class="userInfoText">
                             {{profile.first_name}}  {{profile.last_name}}   
                        </div>
                        <div class="userInfoText">
                             {{profile.city}}, {{profile.country}}
                        </div>
                        
                </div>
                <div class="verticalRightBlock">
                        <div class="box">
                                {% if user_group_list %}
                                        Owned:<br>
                                        <ul type="none">                                        
                                        {% for group in user_group_list %}
                                                <!-- Redirect to group -->
                                               <li>
                                                        <div id="{{ group.group_web_address }}">
                                                                <div>
                                                                        <a href="../../connectpeople/startGroup/{{ group.group_web_address }}">{{ group.group_name }}</a>
                                                                        <a href="#" gwebaddr="{{ group.group_web_address }}" class="delGroup">
                                                                                <img class="groupTrashImg" title="delete" src="/{{ media_url }}/StartGroup/images/trash_icon.png"/>
                                                                        </a>
                                                                </div>
                                                                <div>{{ group.group_city }}, {{ group.group_country }}</div>
                                                        </div>
                                               </li>
                                        {% endfor %}
                                        </ul>
                                {% endif %}
                                <br />
                                <br />
                               
                        </div>
                         <div class="box">
                                {% if user_member_group_list %}
                                        Member Of:<br>
                                        <ul type="none">                                        
                                        {% for mem_group in user_member_group_list %}
                                                <!-- Redirect to group -->
                                               <li>
                                                        <div><a href="../../connectpeople/startGroup/{{mem_group.group.group_web_address }}">{{ mem_group.group.group_name }}</a></div>
                                                        <div>{{ mem_group.group.group_city }}, {{ mem_group.group.group_country }}</div>
                                               </li>
                                        {% endfor %}
                                        </ul>
                                {% endif %}
                                <br />
                                <br />
                               
                        </div>
                        <a href="{% url StartGroup.views.startNewGroupForm %}">Start New Group</a>
                </div>
        </div>
        
       



{% endblock %}


{% block userprofile_content_related %}
        <!--<a href="{% url groupevents.views.CreateNewEventForm %}">Create New Event</a>-->
        <!--<a href="{% url django.contrib.auth.views.password_change %}">Change password</a>-->

{% endblock %}


</body>
</html>


